package spe.ui.properties;

import org.eclipse.ui.views.properties.tabbed.ITypeMapper;

import spe.model.spem.NodeElement;
import spe.ui.editor.part.AbstractElementNodeEditPart;
import spe.ui.editor.part.OutlineEditPart;

public class ElementTypeMapper implements ITypeMapper 
{

	public Class mapType(Object object)
	{
		Class type = object.getClass();
		if (object instanceof AbstractElementNodeEditPart) {
			NodeElement notationElement = (NodeElement) ((AbstractElementNodeEditPart) object).getModel();		
			type = notationElement.getClass();
		} else if (object instanceof OutlineEditPart) {
			type = ((OutlineEditPart)object).getModel().getClass();
		}
		return type;
	}
}